﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TSNPro.Base;
using TSNPro.Communication;
using TSNPro.Communication.Sender;
using TSNPro.Utils;

namespace TSNPro.Device
{
    public class BaseDevice : BaseItem
    {
        private  List<BaseCommunication> _communications = null;
        public BaseDevice()
        {
            
        }

        public virtual void SetCommunication(List<BaseCommunication> communcaition)
        {
            _communications = communcaition;
        }

        public sealed override void SetConfig(JObject obj)
        {
            base.SetConfig(obj);

            List<BaseCommunication> comm = CommunicationManager.GetInstance().GetItems<BaseCommunication>(obj["Communication"].GetStringList());
            SetCommunication(comm);
        }


    }
}
